package com.ch.swagger2.controller.user;

import com.ch.swagger2.model.Account;
import com.ch.swagger2.model.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @author cj-ch
 * @date 2018/4/27 下午4:00
 */
@Api(value = "账户操作相关接口",tags = "账户",description = "")
@RestController
@RequestMapping("/basic/account")
public class AccountController {

    static Map<Long, Account> accounts = Collections.synchronizedMap(new HashMap<>());
    static {
        accounts.put(1L,new Account(1L,"10000002000300","XXXX"));
        accounts.put(2L,new Account(2L,"20003030300300","XXXX22222"));
    }

    @ApiOperation(value = "查询账户列表接口",notes = "查询账户列表接口")
    @GetMapping("/search-all")
    public Response list(){
        return Response.success(accounts);
    }
}
